package com.snc.controller.app;


import com.snc.controller.index.BaseController;
import com.snc.entity.CommentFormMap;
import com.snc.entity.SchoolFormMap;
import com.snc.plugin.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * APP-活动
 */
@Controller
@RequestMapping("/app/school")
public class SchoolController extends BaseController {

    /**
     * 获取活动的列表，
     * 请求参数：
     *
     * @return 数据
     */
    @ResponseBody
    @RequestMapping(value = "/list")
    public Result list() {
        SchoolFormMap map = super.toFormMap(SchoolFormMap.class);
        return Result.Success(map.findByAll());
    }


    @ResponseBody
    @RequestMapping("/pp")
    public Result add() throws Exception {
        SchoolFormMap map = super.toFormMap(SchoolFormMap.class);
        List<SchoolFormMap> list = SchoolFormMap.mapper().pp(map);
        return Result.Success(list.get(0));
    }
}